//
//  LogoScene.m
//  ShoutBoss
//
//  Created by Luck Mstone on 6/15/09.
//  Copyright 2009 MS. All rights reserved.
//

#import "LogoScene.h"
#import "LogoBackGround.h"
#import "MainMenuScene.h"

@implementation LogoScene

-(id) init
{
	self = [super init];
	if(self != nil){
		//LogoScene 初始化工作
		LogoLayer * logoLayer =[LogoLayer node];
		[self addChild: logoLayer];
	}
	
	return self;
}

@end

@implementation LogoLayer
-(id) init
{
	if( ( self=[super init] ))
	{
		self = [super init];
		
		//启动Touch
		isTouchEnabled = YES;
		
		//LogoLayer 初始化工作
		CGSize s = [[Director sharedDirector] winSize];
		
		LogoBackGround* background = [LogoBackGround node];
		[self addChild:background];
		[background setPosition: ccp(s.width/2, s.height/2)];
		
		//标签
		label1 = [Label labelWithString:@"Logo View" fontName:@"Courier" fontSize:32];
		label1.position = ccp(480-120, 320-32);
		[self addChild:label1];
	}	
	return self;
}

- (void) dealloc
{
	[super dealloc];
}

- (BOOL)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
	// 切换到MainMenu
	MainMenuScene* mainMenuScene = [MainMenuScene node];
	[[Director sharedDirector] replaceScene:mainMenuScene];
	
	return kEventHandled;
}
@end

